Skip to content

Instantly share code, notes, and snippets.

@whoant
Created June 4, 2021 13:51
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save whoant/265f7ed8a7d51a019d3fcece2a97f00d to your computer and use it in GitHub Desktop.
Save whoant/265f7ed8a7d51a019d3fcece2a97f00d to your computer and use it in GitHub Desktop.
Tấn công crush (❁´◡`❁)
const ACCESS_TOKEN = '';
const LIST_IGNORE = [];
const getListFriend = () => {
return new Promise(async (resolve, reject) => {
try {
const res = await fetch(
`https://graph.facebook.com/me/friends?limit=5000&access_token=${ACCESS_TOKEN}`
);
const resParse = await res.json();
const reduce = resParse.data.map(item => Number(item.id));
resolve(reduce);
} catch (error) {
reject(error);
}
});
};
const block = listFriend => {
const ID_USER = require('RelayAPIConfigDefaults').actorID;
const fb_dtsg = require('DTSGInitData').token;
const body = new URLSearchParams();
const variables = {
input: {
blocked_participants: listFriend,
actor_id: ID_USER,
client_mutation_id: 6,
},
};
body.append('__a', 1);
body.append('doc_id', 4145463812202174);
body.append('fb_dtsg', fb_dtsg);
body.append('fb_api_caller_class', 'RelayModern');
body.append(
'fb_api_req_friendly_name',
'StoriesCometPrivacySelectorBlockedParticipantsMutation'
);
body.append('variables', JSON.stringify(variables));
return fetch('https://www.facebook.com/api/graphql/', {
method: 'POST',
body,
});
};
Array.prototype.diff = function (arr) {
return this.filter(i => arr.indexOf(i) < 0);
};
(async () => {
try {
const listFriend = await getListFriend();
const diff = listFriend.diff(LIST_IGNORE);
await block(diff);
console.log("Tấn công crush thành công (●'◡'●)");
// block([]);
} catch (error) {
console.log(error);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment